<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('strator_position_has_permissions', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('position_id')->index()->comment('职务角色id');
            $table->unsignedInteger('permission_id')->comment('权限id');

            $table->timestamps();
            $table->softDeletes();
        });

        \DB::statement("ALTER TABLE `strator_position_has_permissions` comment '管理员职务与权限对应表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('strator_position_has_permissions');
    }
};
